<?php 
/**
 * 后台组管理
 * @author chengtao
 *
 */
import('@.Library.User.Group');
class GroupAction extends ManagerBaseAction {
	//显示各种组的表格
	public function index(){
		$Group = Think::instance('Group');
		$group_list = $Group->getGroupList();
		$this->assign('group_list',$group_list);
		$this->display();
	}
	public function update(){
		$Group = Think::instance('Group');
		if($_POST){
			$Group->update();
		}else{
			$group_info = $Group->getGroupInfo();
			$group_auth = $Group->getGroupAuth();
			$this->assign('group_info',$group_info);
			$this->assign('group_auth',$group_auth);
			$Node = M('node');
			$field = "* , CONCAT(path_id,'-',id) as path";
			$order = "path";
			$node_list = $Node->field($field)->order($order)->select();
			$this->assign('list',$node_list);
			$this->assign('list1',$node_list);
			$this->assign('list2',$node_list);
			
			$this->display();
		}
	}
	public function add(){
		$Group = Think::instance('Group');
		if($_POST){
			$Group->add();
		}else{
			$this->display('update');
		}
	}
}
?>